<template>
  <div>
    <h1>AQI 反馈列表</h1>
    <input v-model="telId" placeholder="请输入电话号码" />
    <button @click="fetchFeedbackByTelId">查询反馈</button>
    <ul v-if="feedbackList.length > 0">
      <li v-for="item in feedbackList" :key="item.afId">
        {{ item.information }} - {{ item.afDate }}
      </li>
    </ul>
  </div>
</template>

<script>
import { listAqiFeedbackByTelId } from '@/services/aqiFeedbackService';

export default {
  data() {
    return {
      feedbackList: [],
      telId: '', // 用户输入的电话号码
    };
  },
  methods: {
    async fetchFeedbackByTelId() {
      try {
        this.feedbackList = await listAqiFeedbackByTelId(this.telId);
      } catch (error) {
        alert('获取反馈失败：' + error.message);
      }
    },
  },
};
</script>